package com.meilingcloud.research.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.meilingcloud.research.domain.RwsTaskSample;
import com.meilingcloud.research.mapper.RwsTaskSampleMapper;
import com.meilingcloud.research.service.IRwsTaskSampleService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 课题任务-样本 Service业务层处理
 *
 * @author chenl
 * @date 2021-03-23
 */
@Service
public class RwsTaskSampleServiceImpl extends ServiceImpl<RwsTaskSampleMapper, RwsTaskSample> implements IRwsTaskSampleService {

    @Override
    public List<RwsTaskSample> queryList(RwsTaskSample rwsTaskSample) {
        LambdaQueryWrapper<RwsTaskSample> lqw = Wrappers.lambdaQuery();
        if (rwsTaskSample.getTaskId() != null) {
            lqw.eq(RwsTaskSample::getTaskId, rwsTaskSample.getTaskId());
        }
        if (rwsTaskSample.getSampBackupId() != null) {
            lqw.eq(RwsTaskSample::getSampBackupId, rwsTaskSample.getSampBackupId());
        }
        return this.list(lqw);
    }
}
